﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace benefit.Controllers
{
    public class GroupShowController : System.Web.Mvc.Controller
    {
        public ActionResult IndexShow(int uid, string pdate)
        {
            Benefit.Interface.Sys.IVisitPrower IVisitPrower = new Benefit.Service.Sys.ServiceVisitPrower(db);

            Common.Web.Cookie cookie = new Common.Web.Cookie();
            int operId = Convert.ToInt32(cookie.GetCookie("LoginUserId"));

            if (IVisitPrower.HasGroupPrower(operId, uid))
            {
                Benefit.ViewModel.Day.GroupShow model = new Benefit.ViewModel.Day.GroupShow(uid, pdate, db);
                db.Dispose();
                return View(model);
            }
            else
            {
                db.Dispose();
                return Redirect("/Error/HasNoPrower/" + uid + "/" + pdate);
            }
            return View();
        }

    }
}
